<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    let lesson = `
      js,200元,300元
      php,300.00元,100次
      node.js,180元,260次
    `
    let reg = /(\d+)(.00)?(元)/g
    lesson = lesson.replace(reg, (v,...args)=>{
        console.log(...args);
        args[1] = args[1] || ".00"
        return args.splice(0,3).join("")
    })
    console.log(lesson);
</script>
</html>